<%- include myCenterHeader.ejs %>
<h3 style="color: #d77a03"><b><%= __('partnerCenter').l_active %></b></h3>
<div style="font-size: 18px;color: #9d9d9d;margin-top: 30px">
<% if(datas.length==0){%>
    <div style="height: 200px;text-align: center">
        <span style="line-height: 200px"><%= __('findPartner').hint %>!!!!</span>
    </div>
    <hr style="border: none;border-top: 2px dotted #cac9c4;margin-left: -65px" >
<%}%>
<% datas.forEach(function(data,index){%>
    <div style="width: 200px;float: left;margin-top: 20px">
        <img class="img-rounded" src="<%- data.active.poster%>" style="width: 140px;height: 140px">
    </div>
    <div style="margin-top: 20px;width: 60%;float: left">
        <span><a  target="_blank" style="color: #9d9d9d" href="/activeParticulars?id=<%- data.active._id %>"><%= __('center').a_name%>：<%-data.active.theme%></a></span><br>
        <span><%= __('center').a_particulars%>：</span>
        <div style="margin-left: 30px">
            <%-data.active.discribe%>
        </div>
        <span><%= __('center').a_time%>：<%-data.active.activeDate%></span>
    </div>

    <div style="clear: both;height: 20px"></div>

    <div style="float: right;margin-right: 20%;">
        <span style="font-size: 14px;color: #fca81a"><b><%-data.date.format('yyyy.MM.dd hh:mm:ss')%></b></span>
    </div>
    <hr style="border: none;border-top: 2px dotted #cac9c4;margin-left: -65px" >
<% }) %>
</div>
<div class="span12">
    <div id="page1"></div>
</div>
<%- include myCenterFooter.ejs %>
<script>

    $(function(){
        //获得浏览器参数

        $.extend({
            getUrlVars: function(){
                var vars = [];
                var hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                console.log(hashes);
                for(var i = 0; i < hashes.length; i++){
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            },
            getUrlVar: function(name){
                return $.getUrlVars()[name];
            }
        });

        //封装浏览器参数
        var composeUrlParams=function(){
            var param='';
            $.each($.getUrlVars(), function(i, item) {
                if(item!='num'){
                    var val=$.getUrlVar(item);
                    if(val) param += "&" + item+"="+val;
                }
            });
            return param;
        }
        var options = {
            currentPage:<%- page.num %>,                //当前页，css样式同其他页不同
            totalPages:<%- page.pageCount %>,           //总页数
            numberOfPages:5,                            //导航最多显示页数
            pageUrl: function(type, page, current) {    //页面跳转
                if(page!=<%- page.num %>){
                    return "/myLoveActive?num="+ page+composeUrlParams();
                }

            }
        }
        $('#page1').bootstrapPaginator(options);
    })
</script>